# $Id: PKGBUILD 89549 2013-04-29 23:06:17Z arodseth $
# Maintainer: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Jan Steffens <heftig@archlinux.org>

pkgname=pdns-recursor
pkgver=3.5
pkgrel=1
pkgdesc='PowerDNS recursor'
url='https://www.powerdns.com/'
license=('GPL')
arch=('x86_64' 'i686')
depends=('gcc-libs' 'lua51')
makedepends=('boost')
backup=('etc/powerdns/recursor.conf')
source=("http://downloads.powerdns.com/releases/$pkgname-$pkgver.tar.bz2"
        'pdns-recursor.service')
sha256sums=('02ea398aa0e95ef4c9caf478eb3836598eabcd5c99ccb7e2e7c265d716089549'
            'c5849127cb42b578ff4c38ee6ad39e109bb749ce8b0147ac3619af90803b6875')

build() {
  cd "$srcdir/$pkgname-$pkgver"

  make LUA=1 \
    LUA_CPPFLAGS_CONFIG="$(pkg-config --cflags lua5.1)" \
    LUA_LIBS_CONFIG="$(pkg-config --libs lua5.1)"
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  make DESTDIR="$pkgdir" install
  mv "$pkgdir/etc/powerdns/recursor.conf-dist" "$pkgdir/etc/powerdns/recursor.conf"
  rm -r "$pkgdir/etc/init.d"
  install -Dm644 "$srcdir/pdns-recursor.service" \
    "$pkgdir/usr/lib/systemd/system/pdns-recursor.service"
}

# vim:set ts=2 sw=2 et:
